#ifndef IDLE_H
#define IDLE_H

#include <defs/export.h>
#include <defs/global.h>

#include <functional>
#include "pch.h"


namespace Core
{

    O_PRIVATE_DECLARE(Idle);
    class CORE_EXPORT Idle : public QObject
    {
        Q_OBJECT

    public:
        static void SingleShot(int timeout, const std::function<void()> &target);
    protected:
        explicit Idle(const std::function<void()> &target);
        ~Idle();

    protected slots:
        void invokeOnce();
    private:
        O_PRIVATE_DECLARE_MEMBER(Idle);
    };

}
#endif // IDLE_H


